<?php
include_once "config/config.php";
include_once "config/helper.php";
//check controller
$controller = $_REQUEST['controller'];
$controller= ( $controller == null ? "default" : $controller );
//check action
$action = $_REQUEST['action'];
$action = ( $action == null ? "index" : $action );
//load the controller
//apply parent controller rules
include_once "ct/super.php";

//now load the requested controller
if (file_exists("ct/".urlencode($controller).".php")) //verify if the controller file really exists
{
	include_once "ct/".urlencode($controller).".php"; //load it
}
else
{
	echo "The requested file does not exist!"; //display an error message
}





//Utility function to include classes as and when they are required
//move this to some other file in version
function __autoload($file)
{
		 include_once "cl/".urlencode($file).".php";
}

?>
